package com.jialiang.blossom.consts;

import cn.hutool.core.util.ObjectUtil;

public enum Gua_64 {

    QIAN(1, "乾", "天", "111111"),
    KUN(2, "坤", "地", "000000"),
    ZHUN(3, "屯", "水雷屯", "010001"),
    MENG(4, "蒙", "山水蒙", "100010"),
    XU(5, "需", "水天需", "010111"),
    SONG(6, "讼", "天水讼", "111010"),
    SHI(7, "师", "地水师", "000010"),
    BI(8, "比", "水地比", "010000"),
    XIAOCHU(9, "小畜", "风天小畜", "110111"),
    LV(10, "履", "天泽履", "111011"),
    TAI(11, "泰", "地天泰", "111000"),
    PI(12, "否", "天地否", "000111"),
    TONGREN(13, "同人", "天火同人", "111101"),
    DAYOU(14, "大有", "火天大有", "101111"),
    QIAN2(15, "谦", "地山谦", "000100"),
    YU(16, "豫", "雷地豫", "001000"),
    SUI(17, "随", "泽雷随", "011001"),
    GU(18, "蛊", "山风蛊", "100110"),
    LIN(19, "临", "地泽临", "000011"),
    GUAN(20, "观", "风地观", "110000"),
    SONG2(21, "噬嗑", "山雷噬嗑", "100001"),
    SHI2(22, "贲", "山火贲", "100101"),
    YI(23, "剥", "地山剥", "000100"),
    BIAN(24, "复", "雷地复", "001000"),
    KUN2(25, "无妄", "天雷无妄", "111001"),
    XIAN(26, "大畜", "天山大畜", "000100"),
    QIAN3(27, "颐", "雷天颐", "001111"),
    YI2(28, "大过", "泽风大过", "011110"),
    GUAI(29, "坎", "水坎", "010010"),
    JING(30, "离", "火离", "101101"),
    GE(31, "咸", "山水咸", "100101"),
    DUN(32, "恒", "雷风恒", "001110"),
    HENG(33, "遁", "天山遁", "111100"),
    XIAOCHU2(34, "大壮", "雷天大壮", "001111"),
    JIN(35, "晋", "火地晋", "101000"),
    MINGYI(36, "明夷", "地火明夷", "000101"),
    JIAREN(37, "家人", "风火家人", "110101"),
    KUI(38, "睽", "火泽睽", "101011"),
    GUI(39, "蹇", "水山蹇", "010100"),
    JIAN(40, "解", "雷水解", "001010"),
    XIAN2(41, "损", "泽山损", "011100"),
    SHENG(42, "益", "风雷益", "110001"),
    GOU(43, "夬", "泽天夬", "011111"),
    ZHEN(44, "姤", "天风姤", "111110"),
    GOU2(45, "萃", "泽地萃", "011000"),
    JIAN2(46, "升", "地风升", "00011"),
    KUN3(47, "困", "泽水困", "011010"),
    JIE(48, "井", "水风井", "010110"),
    KAN(49, "革", "泽火革", "011101"),
    GENG(50, "鼎", "火风鼎", "101110"),
    DING(51, "震", "雷震", "001001"),
    GEN(52, "艮", "山艮", "100100"),
    XUN(53, "渐", "风山渐", "110100"),
    JI(54, "归妹", "雷泽归妹", "001011"),
    SHI3(55, "丰", "风火丰", "100101"),
    XIAN3(56, "旅", "火山旅", "101100"),
    DAZHUANG(57, "巽", "巽为风", "110110"),
    QIAN4(58, "兑", "兑为泽", "011011"),
    HUAN(59, "涣", "水风涣", "101110"),
    JIE2(60, "节", "泽水节", "011010"),
    ZHONGFU(61, "中孚", "风泽中孚", "110011"),
    XIAOGUO(62, "小过", "山风小过", "100110"),
    GUAN2(63, "既济", "火水既济", "101010"),
    WEIJI(64, "未济", "水火未济", "010101");

    private int code;
    private String name;
    private String meaning;
    private String binary;


    /**
     * 根据 binary 获取枚举
     *
     * @param binary
     * @return
     */
    public static Gua_64 getEnumByValue(String binary) {
        if (ObjectUtil.isEmpty(binary)) {
            return null;
        }
        for (Gua_64 anEnum : Gua_64.values()) {
            if (anEnum.binary.equals(binary)) {
                return anEnum;
            }
        }
        return null;
    }

    Gua_64(int code, String name, String meaning, String binary) {
        this.code = code;
        this.name = name;
        this.meaning = meaning;
        this.binary = binary;
    }

    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public String getMeaning() {
        return meaning;
    }

    public String getBinary() {
        return binary;
    }
}